<script>
import axios from "axios";

export default {
  name: "ApplyList",
  data(){
    return {
      loanList:[],
    }
  },
  mounted() {
    axios.get("http://localhost:8080/getUserByToken",{
      headers:{
        Authorization: localStorage.getItem("token")
      }
    }).then((response) => {
      this.loanList = response.data.data.loans;
      console.log(response.data.data.loans);
    })
  }
}

</script>

<template>
  <div class="h-[calc(80%)] bg-red-400 flex flex-wrap">
    <el-card style="width:100%;height: 100%;" >
      <template #header>申请记录表</template>
      <div v-for="items in loanList" class="border-b">
        贷款申请时间:{{items.loanDate}}<br>
        贷款申请金额:{{items.loanAccount}}<br>
        贷款用途:{{items.loanUse}}<br>
        贷款还款期限:{{items.loanDay}}(天)<br>
        审核状态:{{items.auit}}<br>
        贷款编号:{{items.loanId}}<br>
        <a :href="`contact.html?loanId=${items.loanId}`"><el-button>查看合同</el-button></a>
      </div>
    </el-card>
  </div>
</template>

<style scoped>

</style>